clang-tidy readability-simplify-boolean-expr on gui.
authortsteven4 <tsteven4@gmail.com>
Sun, 3 Mar 2019 17:46:54 +0000 (10:46 -0700)
committertsteven4 <tsteven4@gmail.com>
Sun, 3 Mar 2019 17:46:54 +0000 (10:46 -0700)
gui/format.cc
gui/gmapdlg.cc
gui/mainwindow.cc

index 6607bd4affdc0fb21766626b5cd70cf3ab86750d..b609e7a4ac1165e6ec11e1e3753b0ffc63650f20 100644 (file)
@@ -70,7 +70,7 @@ void Format::restoreSettings(QSettings& settings)
 void Format::setToDefault()
 {
   for (int i=0; i<inputOptions_.size(); i++) {
-    if (inputOptions_[i].getType() == FormatOption::OPTbool && inputOptions_[i].getDefaultValue().toBool() == true) {
+    if (inputOptions_[i].getType() == FormatOption::OPTbool && inputOptions_[i].getDefaultValue().toBool()) {
       inputOptions_[i].setSelected(true);
     } else {
       inputOptions_[i].setSelected(false);
@@ -78,7 +78,7 @@ void Format::setToDefault()
     inputOptions_[i].setValue(QVariant());
   }
   for (int i=0; i<outputOptions_.size(); i++) {
-    if (outputOptions_[i].getType() == FormatOption::OPTbool && outputOptions_[i].getDefaultValue().toBool() == true) {
+    if (outputOptions_[i].getType() == FormatOption::OPTbool && outputOptions_[i].getDefaultValue().toBool()) {
       outputOptions_[i].setSelected(true);
     } else {
       outputOptions_[i].setSelected(false);
index c69177ae58b4479da0c0093a265ab0f944f1c243..d3894841070615afaaff3d211941aa26f83e90cb 100644 (file)
@@ -498,7 +498,7 @@ void GMapDialog::showOnlyThisWaypoint()
 {
   QList <GpxWaypoint>& tlist = gpx_.getWaypoints();
   for (int i=0; i<tlist.size(); i++) {
-    tlist[i].setVisible(i == menuIndex_? true: false);
+    tlist[i].setVisible(i == menuIndex_);
     trkList_[i]->setCheckState(i==menuIndex_? Qt::Checked: Qt::Unchecked);
   }
   wptItem_->setCheckState(Qt::Checked);
@@ -509,7 +509,7 @@ void GMapDialog::showOnlyThisTrack()
 {
   QList <GpxTrack>& tlist = gpx_.getTracks();
   for (int i=0; i<tlist.size(); i++) {
-    tlist[i].setVisible(i == menuIndex_? true: false);
+    tlist[i].setVisible(i == menuIndex_);
     trkList_[i]->setCheckState(i==menuIndex_? Qt::Checked: Qt::Unchecked);
   }
   trkItem_->setCheckState(Qt::Checked);
@@ -521,7 +521,7 @@ void GMapDialog::showOnlyThisRoute()
 {
   QList <GpxRoute>& rlist = gpx_.getRoutes();
   for (int i=0; i<rlist.size(); i++) {
-    rlist[i].setVisible(i == menuIndex_? true: false);
+    rlist[i].setVisible(i == menuIndex_);
     rteList_[i]->setCheckState(i==menuIndex_? Qt::Checked: Qt::Unchecked);
   }
   rteItem_->setCheckState(Qt::Checked);
index 26490c7aca4bee08da6879ab46795aea7afd69bc..3e7a9723a58660a8a7229b64ed8defd9906e0729 100644 (file)
@@ -849,9 +849,9 @@ bool MainWindow::isOkToGo()
     return false;
   }
 
-  if (babelData_.outputType_ == BabelData::noType_ && babelData_.previewGmap_ == true) {
+  if (babelData_.outputType_ == BabelData::noType_ && babelData_.previewGmap_) {
   }
-  if (babelData_.outputType_ == BabelData::noType_ && babelData_.previewGmap_ == false) {
+  if (babelData_.outputType_ == BabelData::noType_ && !babelData_.previewGmap_) {
     QMessageBox::information(nullptr, QString(appName), tr("No valid output specified"));
     return false;
   } else if (babelData_.outputType_ == BabelData::fileType_ &&